<?php
/**
 * $Id: default.php 7 2010-04-26 20:05:00Z webbochsant $
 *  @package	Joomla
 *  @author Daniel Eliasson
* 	@copyright	Copyright (C) 2010 Stilero. All rights reserved.
* 	@license	GNU/GPL, see LICENSE.php
* 	Joomla! is free software. This version may have been modified pursuant
* 	to the GNU General Public License, and as distributed it includes or
* 	is derivative of works licensed under the GNU General Public License or
* 	other free or open source software licenses.
*/

// no direct access
defined('_JEXEC') or die('Restricted access'); 


?>
<form action="index.php" method="post" name="adminForm">
<div id="editcell">
    <table class="adminlist">
    <thead>
        <tr> 	
            <th width="5">
                <?php echo JText::_( 'ID' ); ?>
            </th>
            <th width="20">
    			<input type="checkbox" name="toggle" value="" onclick="checkAll(<?php echo count( $this->items ); ?>);" />
			</th>        
            <th>
                <?php echo JText::_( 'Competition' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Contestant' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Link' ); ?>
            </th>
            <th>
                <?php echo JText::_( 'Date' ); ?>
            </th>
            <th width="5">
            
                <?php echo JText::_( 'Notified' ); ?>
            </th>
        </tr>            
    </thead>
    <?php
    $k = 0;
    for ($i=0, $n=count( $this->items ); $i < $n; $i++)
    {
        $row =& $this->items[$i];
        $checked    = JHTML::_( 'grid.id', $i, $row->wid );
        $link = JRoute::_( 'index.php?option=com_vmcompetition&controller=winners&task=edit&cid[]='. $row->wid );
        $linkcont = JRoute::_( 'index.php?option=com_vmcompetition&controller=contestants&task=edit&cid[]='. $row->cont_id );
        //$linkcmp = JRoute::_( 'index.php?option=com_vmcompetition&controller=vmcompetition&task=edit&cid[]='. $row->comp_id );
        
        ?>
        <tr class="<?php echo "row$k"; ?>">    	
            <td>
                <?php echo $row->wid; ?>
            </td>
            <td>
    			<?php echo $checked; ?>
			</td>
            <td>
                <a href="<?php echo $link; ?>"><?php echo $row->comp_name; ?></a>            
            </td>    
            <td>
                <a href="<?php echo $linkcont; ?>"><?php echo $row->cont_name; ?></a>
            </td>
            <td>
                <a href="<?php echo $row->linkurl; ?>" target="_blank"><?php echo $row->linkurl; ?></a>
            </td>
           	<td>
                <?php echo $row->date; ?>
            </td>
           	<td>
           	<?php 
           		$row->published = $row->notified;
				$notified		= JHTML::_('grid.published', $row, $i );
			?>
                <?php echo $notified; ?>
            </td>
        </tr>
        <?php
        $k = 1 - $k;
    }
    ?>
    <tfoot>
    <tr>
      <td colspan="9"><?php echo $this->pagination->getListFooter(); ?></td>
    </tr>
  </tfoot>
    
    </table>
</div>
 
<input type="hidden" name="option" value="com_vmcompetition" />
<input type="hidden" name="task" value="" />
<input type="hidden" name="boxchecked" value="0" />
<input type="hidden" name="controller" value="winners" />
 
</form>
